<template>
  <div>
    <div class="tost-box">
      <!-- <img src="../../../../../static/image/tanhao.png"> -->
      <span>您的团队有{{ eunumber }}个计划超时未处理</span>
      <!-- 您的团队有2个计划超时未处理 -->
    </div>
    <Table :columns="columns" :data="pcWorkIndexSupervisorListVO.records" :loading="isLoading"
      :row-class-name="rowClassName" style="margin-top:10px">
      <template slot-scope="{ row }" slot="payYears">
        <span>{{ row.payYear + "/" + row.payYears + row.payintv }}</span>
      </template>
      <template slot-scope="{ row }" slot="invalidDate">
        <span>{{ row.invalidDate ? row.invalidDate.slice(0, 10) : '' }}</span>
      </template>
      <template slot-scope="{ row }" slot="planDate">
        <span>{{ row.planDate ? row.planDate.slice(0, 10) : '' }}</span>
      </template>
      <template slot-scope="{row}" slot="planstatename">
        <span v-if="row.planstatename == '未服务'">
          <Button class="status-error" size="small">{{ row.planstatename }}</Button>
        </span>
        <span v-if="row.planstatename == '服务中'">
          <Button class="status-info" size="small">{{ row.planstatename }}</Button>
        </span>
        <span v-if="row.planstatename == '已完成'">
          <Button class="status-default" size="small">{{ row.planstatename }}</Button>
        </span>
      </template>
      <template slot-scope="{ row }" slot="operate">
        <span class="table-button" @click="forward(row)">查看详情</span>
      </template>
    </Table>

    <!-- <Page :total="ipagination.total" show-sizer show-total style="text-align:right;margin-top:20px"
      @on-change="handleCurrentChange" @on-page-size-change="handleSizeChange"
      :page-size-opts="ipagination.pageSizeOptions" :current="ipagination.pageIndex" :page-size="ipagination.pageSize"
      transfer></Page> -->
  </div>
</template>

<script>
import { loadResourcesMixin } from "../../../../util/mixins/loadResourcesMixin";
import { tableChangeMixin } from "../../../../util/mixins/tableChangeMixin";
export default {
  name: "disabled",
  mixins: [ tableChangeMixin],
  data() {
    return {
      mixinData: {
        tableAxios: "getPCWorkIndex",
      },
      eunumber: 554,
      columns: [
        {
          title: "序号",
          type: "index",
          align: "center",
          width: 80,
        },
        {
          title: "保单号",
          key: "contNo",
          width: "190",
          align: "center",
        },
        {
          title: "投保人",
          key: "appntName",
          align: "center",
          width: "110",
        },
        {
          title: "应交日",
          key: "payToDay",
          align: "center",
          width: "130",
        },
        {
          title: "已交次数",
          slot: "payYears",
          align: "center",
          width: "100",
        },
        {
          title: "应收保费",
          key: "premium",
          align: "center",
          width: "150",
        },
        {
          title: "失效日",
          slot: "invalidDate",
          align: "center",
          width: "150",
        },
        {
          title: "失效天数",
          key: "invalidDay",
          align: "center",
          width: "150",
        },
        {
          title: "计划工作时间",
          slot: "planDate",
          align: "center",
          width: "150",
        },
        {
          title: "计划工作方式",
          key: "planWorkType",
          align: "center",
          minWidth: 160,
        },
        {
          title: "业务员",
          key: "agentName",
          align: "center",
          width: "160",
        },
        {
          title: "专员",
          key: "attacheName",
          align: "center",
          width: "160",
        },
        {
          title: "操作",
          key: "operate",
          slot: "operate",
          align: "center",
          width: "120",
          fixed: "right",
        },
      ],
      pcWorkIndexSupervisorListVO: { records: [
  {
    "planId": "1639357351799529473",
    "workId": "1639357351807918082",
    "contNo": "112202100631249",
    "disposestate": "Y",
    "appntName": "徐亚良",
    "payToDay": "2023-03-06",
    "payYear": "2",
    "payYears": "10",
    "payintv": "年交",
    "premium": "12000.00",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "1000002789",
    "agentName": "张静秀",
    "invalidDate": "2022-08-16 00:00:00",
    "invalidDay": "337",
    "wideEndDate": "2023-05-05 00:00:00",
    "reagentcode": "6120000001",
    "attacheName": "杨静",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357351975690241",
    "workId": "1639357351984078849",
    "contNo": "213202122448346",
    "disposestate": "Y",
    "appntName": "刘彦旭",
    "payToDay": "2023-04-09",
    "payYear": "2",
    "payYears": "3",
    "payintv": "年交",
    "premium": "50000.00",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "3130000141",
    "agentName": "刘金鹏",
    "invalidDate": "2022-07-07 00:00:00",
    "invalidDay": "377",
    "wideEndDate": "2023-06-08 00:00:00",
    "reagentcode": "6130100003",
    "attacheName": "时林",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357352256708610",
    "workId": "1639357352265097218",
    "contNo": "713202100393827",
    "disposestate": "Y",
    "appntName": "郭辰辉",
    "payToDay": "2023-03-14",
    "payYear": "2",
    "payYears": "5",
    "payintv": "年交",
    "premium": "10000.00",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "8613000031",
    "agentName": "陈华",
    "invalidDate": "2022-05-26 00:00:00",
    "invalidDay": "419",
    "wideEndDate": "2023-05-13 00:00:00",
    "reagentcode": "6130100003",
    "attacheName": "时林",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357352281874434",
    "workId": "1639357352290263041",
    "contNo": "713202100438377",
    "disposestate": "Y",
    "appntName": "刘朝芸",
    "payToDay": "2023-04-03",
    "payYear": "2",
    "payYears": "5",
    "payintv": "年交",
    "premium": "30000.00",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "8613000020",
    "agentName": "孙卫东",
    "invalidDate": "2022-06-16 00:00:00",
    "invalidDay": "398",
    "wideEndDate": "2023-06-02 00:00:00",
    "reagentcode": "6130100003",
    "attacheName": "时林",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357352357371906",
    "workId": "1639357352365760513",
    "contNo": "112201600028518",
    "disposestate": "Y",
    "appntName": "王铁源",
    "payToDay": "2023-03-31",
    "payYear": "7",
    "payYears": "20",
    "payintv": "年交",
    "premium": "5913.00",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "1000001672",
    "agentName": "王铁源",
    "invalidDate": "2022-05-30 00:00:00",
    "invalidDay": "415",
    "wideEndDate": "2023-05-30 00:00:00",
    "reagentcode": "6120000002",
    "attacheName": "李斌",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357352407703553",
    "workId": "1639357352416092161",
    "contNo": "211202122508286",
    "disposestate": "Y",
    "appntName": "刘晓曼",
    "payToDay": "2023-04-16",
    "payYear": "2",
    "payYears": "3",
    "payintv": "年交",
    "premium": "300000.00",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "3110000114",
    "agentName": "张毅彬",
    "invalidDate": "2023-03-16 00:00:00",
    "invalidDay": "125",
    "wideEndDate": "2023-06-15 00:00:00",
    "reagentcode": "6110100001",
    "attacheName": "孙涛",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357352617418753",
    "workId": "1639357352625807362",
    "contNo": "113202030040046",
    "disposestate": "Y",
    "appntName": "张帆",
    "payToDay": "2023-04-16",
    "payYear": "3",
    "payYears": "20",
    "payintv": "年交",
    "premium": "1657.74",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "1130000222",
    "agentName": "王娅茹",
    "invalidDate": "2022-08-08 00:00:00",
    "invalidDay": "345",
    "wideEndDate": "2023-06-15 00:00:00",
    "reagentcode": "6130100003",
    "attacheName": "时林",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357352864882690",
    "workId": "1639357352873271298",
    "contNo": "212202122157296",
    "disposestate": "Y",
    "appntName": "韩仁英",
    "payToDay": "2023-02-06",
    "payYear": "2",
    "payYears": "5",
    "payintv": "年交",
    "premium": "2000.00",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "3000000120",
    "agentName": "郑佳奇",
    "invalidDate": "2022-06-20 00:00:00",
    "invalidDay": "394",
    "wideEndDate": "2023-04-07 00:00:00",
    "reagentcode": "6120000002",
    "attacheName": "李斌",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357352915214338",
    "workId": "1639357352923602946",
    "contNo": "211202122442476",
    "disposestate": "Y",
    "appntName": "张金运",
    "payToDay": "2023-04-09",
    "payYear": "2",
    "payYears": "3",
    "payintv": "年交",
    "premium": "30000.00",
    "planDate": null,
    "planWorkType": null,
    "agentcode": "3110000114",
    "agentName": "张毅彬",
    "invalidDate": "2022-07-05 00:00:00",
    "invalidDay": "379",
    "wideEndDate": "2023-06-08 00:00:00",
    "reagentcode": "6110100001",
    "attacheName": "孙涛",
    "planstate": "0",
    "planstatename": "未服务"
  },
  {
    "planId": "1639357351719837698",
    "workId": "1656485800631902210",
    "contNo": "112201700057098",
    "disposestate": "Y",
    "appntName": "王露潼",
    "payToDay": "2023-04-06",
    "payYear": "6",
    "payYears": "20",
    "payintv": "年交",
    "premium": "8132.00",
    "planDate": "2020-06-05 00:00:00",
    "planWorkType": "电话联系客户",
    "agentcode": "1000002162",
    "agentName": "王露潼",
    "invalidDate": "2022-11-28 00:00:00",
    "invalidDay": "233",
    "wideEndDate": "2023-06-05 00:00:00",
    "reagentcode": "6120000002",
    "attacheName": "李斌",
    "planstate": "1",
    "planstatename": "服务中"
  }
] },
    };
  },
  created() {
    // this.form.agentSelectType = 2;
    // this.form.managerSelectType = 2;
  },
  methods: {
    rowClassName(row, index) {
      if (row.disposestate == 'F') return "table-bgc";
    },
    // 工作状态跳转
    forward(row) {
      row.contno = row.contNo || row.contno;
      row.planid = row.planId || row.planid;
      row.workid = row.workId || row.workid;
      row.agentcode = row.agentCode || row.agentcode;
      row.paytodate = row.payToDay || row.paytodate;
      row.reagentcode = row.reagentCode || row.reagentcode;
      this.$router.push({
          name: "ServiceDetail",
        query: {
          row: row,
          insuranceType: "disabled",
        },
      });
    },
    tableThen(res) {
      this.eunumber = res.data.eunumber;
      this.pcWorkIndexSupervisorListVO = res.data.pcWorkIndexSupervisorListVO;
    },
    updateIpagination(res) {
      let data = res.data.pcWorkIndexSupervisorListVO;
      this.ipagination.total =
        +data.total || (data.total == 0 ? 0 : this.ipagination.total);
      this.ipagination.index = +data.current || this.ipagination.index;
      this.ipagination.pageSize = +data.size || this.ipagination.pageSize;
    },
  },
};
</script>
<style scoped>
.tost-box {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #fff7ea;
  border-radius: 4px;
  color: #ee8623;
  font-size: 14px;
  margin-bottom: 10px;
}

.tost-box>img {
  width: 14px;
  height: 14px;
  margin-right: 10px;
}
</style>
